﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.UI.WebControls;
using SDT.Model;
using SDT.Lib.Paging;
using SDT.Systems;

namespace SDT.Admin.ViewModels
{
    /// <summary>
    /// Author: Takamaru Nguyen
    /// Date: 23/06/2011
    /// </summary>
    public class LegalDocumentViewModels
    {
        public IPagedList<LegalDocument> Documents;
        public TreeNodeCollection Categories = new TreeNodeCollection();
        public int CurrentCat;
        public int? CurrentPubStatus;
        public string Keyword;
        public Dictionary<object, object> LegCategoryDefault = new Dictionary<object, object>();
        public Dictionary<object, object> LegPublisherDefault = new Dictionary<object, object>();
        public List<SelectListItem> ListStatusPub
        {
            get
            {
                List<SelectListItem> list = new CommonType().ToList();
                if (this.CurrentPubStatus.HasValue)
                    list.SingleOrDefault(i => int.Parse(i.Value) == this.CurrentPubStatus.Value).Selected = true;

                return list;
            }
        }
        
        public string ImageRootUrl;
    }

    /// <summary>
    /// Author: Takamaru Nguyen
    /// Date: 23/06/2011
    /// </summary>
    public class LegalDocumentInputModels
    {
        public TreeNodeCollection Categories = new TreeNodeCollection();
        public LegalDocument Document = new LegalDocument();
        public List<Document> listDocu = new List<Document>();
        public string ImageRootUrl;
        public Dictionary<object, object> LegCategoryDefault = new Dictionary<object, object>();
        public Dictionary<object, object> LegPublisherDefault = new Dictionary<object, object>();
        public string CurrentPublic { get; set; }
        public string CurrentCategory { get; set; }
        public string SeconPublic { get; set; }
    }
}
